# Contributor: Jonas <3426-spameier@users.gitlab.alpinelinux.org>
# Maintainer: Jonas <3426-spameier@users.gitlab.alpinelinux.org>
pkgname=texstudio
pkgver=4.2.3
pkgrel=0
pkgdesc="fully featured LaTeX editor"
url="https://www.texstudio.org"
arch="all"
license="GPL-3.0-or-later"
depends="qt5-qtbase"
makedepends="qt5-qtbase-dev qt5-qttools-dev qt5-qtsvg-dev qt5-qtscript-dev
	qt5-qttools-dev poppler-qt5-dev qt5-qtdeclarative-dev"
source="$pkgname-$pkgver.tar.gz::https://github.com/texstudio-org/texstudio/archive/$pkgver.tar.gz"

build() {
	QTDIR=/usr/lib/qt5
	PATH=$QTDIR/bin:$PATH
	LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH
	DYLD_LIBRARY_PATH=$QTDIR/lib:$DYLD_LIBRARY_PATH
	export QTDIR PATH LD_LIBRARY_PATH DYLD_LIBRARY_PATH
	qmake-qt5 PREFIX=/usr CONFIG-=debug CONFIG-=debug_and_release CONFIG+=release texstudio.pro
	make
}

check() {
	qmake-qt5
	make
}

package() {
	mkdir -p "$pkgdir/usr/share"
	make INSTALL_PATH="$pkgdir" INSTALL_ROOT="$pkgdir" PREFIX="/usr" install
}
sha512sums="
31ce9a78994c171673413fad580c72b4b163050b229e27433b0d527afd5d8fae1849938784c6ceb4e27ff4757cd627d048009ca51313d13f18e558837c8b35f2  texstudio-4.2.3.tar.gz
"
